package com.sunjee.system.service.api;

import cn.hutool.core.bean.BeanUtil;
import com.sunjee.dubbo.dto.SysUserDTO;
import com.sunjee.dubbo.service.system.SysUserApiService;
import com.sunjee.system.domain.SysUser;
import com.sunjee.system.service.SysUserService;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author lihanbo
 */
@Service
@DubboService
public class SysUserApiServiceImpl implements SysUserApiService {

    @Autowired
    private SysUserService sysUserService;

    @Override
    public SysUserDTO getUserInfo(Long id) {
        SysUser sysUser = sysUserService.getById(id);
        SysUserDTO sysUserDTO = BeanUtil.toBean(sysUser, SysUserDTO.class);
        return sysUserDTO;
    }
}
